package com.ysy.controller;


import com.ysy.entity.UserLoginReq;
import com.ysy.persimmons.common.response.Response;
import com.ysy.service.AuthService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthController {


    @Resource
    private AuthService authService;


    @PostMapping("/login")
    public Response<String> login(@Valid @RequestBody UserLoginReq req) {
        return authService.doLogin(req);
    }
    @PostMapping("/logout")
    public Response<?> logout() {
        return authService.logout();
    }



}
